import { getData } from '@/services/analysisApi'
export default {
    namespace: 'overViewAnalysis',
    state: {},
    effects: {
        *getData({ payload, callback }, { call, put }) {
            const response = yield call(getData, payload);
            if (response) {
                if (callback && typeof callback === 'function') {
                    callback(response);
                }
                yield put({
                    type: 'search',
                    payload: response,
                });
            }
        },
    },

    reducers: {
        search(state, { payload }) {
            return {
                ...state,
                ...payload,
            };
        },
    }

}